package behavioral.iterator;

/**
 * @Description: 测试类
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class IteratorTest {
    public static void main(String[] args) {
        Company company = new Company();
        company.addEmployee(new Employee("小明", "1"));
        company.addEmployee(new Employee("小红", "2"));
        company.addEmployee(new Employee("小青", "3"));

        IIterator iterator = company.getIterator();

        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
